// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "./App";
import router from "./router";
import "element-ui/lib/theme-chalk/index.css";
import "@/styles/index.scss"; // global css

import Element from "element-ui";
import i18n from "./lang"; // 引用i8n语言包
import "@/icons"; // icon
import "@/permission"; // permission control
import * as socketApi from "@/api/socket"; // socket连接
import store from "@/store";

import type from "@/utils/type";
import update from "@/utils/update";

import ElTreeGrid from "element-tree-grid";

// import Print from "vue-print-nb";

Vue.component(ElTreeGrid.name, ElTreeGrid);
// Vue.use(Print); // 注册

Vue.prototype.socketApi = socketApi; // 引用自己定义的函数
Vue.use(type); // 引用自己定义的上传文件函数
Vue.use(update);

Vue.use(Element, {
  size: "small", // set element-ui default size
  i18n: (key, value) => i18n.t(key, value)
});

Vue.config.productionTip = false;

/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  i18n,
  store,
  components: { App },
  template: "<App/>"
});
